<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$return['merch']=$merch;
	$avatar=pdo_getcolumn('core_members',array('uniacid'=>$_SESSION['uniacid'],'id'=>$_SESSION['uid']),'avatar');
	$return['merch']['logo']=$return['merch']['logo']?$return['merch']['logo']:$avatar;
	$return['lunum']=pdo_count('jy_goodserpfw_merchlog',array('uniacid'=>$_SESSION['uniacid'],'type'=>0,'merchid'=>$this->merchid));
	$return['chunum']=pdo_count('jy_goodserpfw_merchlog',array('uniacid'=>$_SESSION['uniacid'],'type'=>1,'merchid'=>$this->merchid));
	$return['tuium']=pdo_count('jy_goodserpfw_merchlog',array('uniacid'=>$_SESSION['uniacid'],'type'=>3,'merchid'=>$this->merchid));
	$return['lunumday']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>0,'code_type'=>1,'merchid'=>$this->merchid));
	$return['lunum2day']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>0,'code_type'=>0,'merchid'=>$this->merchid));
	$return['chunumallday']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>1,'xiang_id'=>0,'merchid'=>$this->merchid));
	$return['chunumday']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>1,'xiang_id'=>0,'merchid'=>$this->merchid));
	$return['chunum2day']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>1,'xiang_id >'=>0,'merchid'=>$this->merchid));
	$return['tuinumday']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>3,'xiang_id'=>0,'merchid'=>$this->merchid));
	$return['tuinum2day']=pdo_count('jy_goodserpfw_merchlog',array('createtime >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'type'=>3,'xiang_id >'=>0,'merchid'=>$this->merchid));
	$return['buynum']=pdo_count('jy_goodserpfw_kulog',array('uniacid'=>$_SESSION['uniacid'],'type'=>1,'merchid'=>$this->merchid));
	$return['footernav']=array(
		array('title'=>'代理商','icon'=>'icon-shouye','action'=>'jy_goodserpfw/merch.index/'),
		array('title'=>'操作记录','icon'=>'icon-yonghujieru','action'=>'jy_goodserpfw/merch.kulog/'),
	);
	set_html('title','经销员管理');
	exi($return);
}